<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of CategoriesDropDownList
 *
 * @author dell
 */
class CategoriesDropDownList extends CWidget {
    public $selectedId;
    public $categories;

    public function init() {
		$this->categories = TermsTaxonomy::model()->getCategories(true);
    }

    public function run() {
		$this->renderContent();
    }

    public function setSelectedId($categoryId) {
        $this->selectedId = $categoryId;
        return $this;
    }

    public function renderContent($return = false) {
        return $this->render('categories-drop-down-list', array(
                'categories' => $this->categories
            ), $return
        );
    }
}
